package com.lanmon.base;

import java.util.List;


public class PageEntity<T> {
	private int page;
	private int limit;
	private int start;
	private int totalPageCount;
	private List<T> result;
	
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	public int getPageCount() {
		if(limit == 0)
			throw new ArithmeticException("单页记录数不能为0");
		return (totalPageCount + 1) / limit;
	}
	public List<T> getResult() {
		return result;
	}
	public void setResult(List<T> result) {
		this.result = result;
	}
	
	
}
